<nz-card>
  <div class="mb-md">

    <label> 名称:
      <input nz-input [(ngModel)]="this.searchBeans[0].attributeValue" style="width: 150px;"
             class="mr-sm" />
    </label>

    <button nz-button (click)="this.loadListData()" [nzType]="'primary'">搜索</button>
    <button nz-button (click)="this.clearParam(); this.loadListData()">重置</button>
  </div>

  <nz-divider [nzDashed]=true  style="margin: 0;padding: 0"></nz-divider>

  <div style="padding: 10px;">
    <button nz-button (click)="open()" [nzType]="'primary'">新增</button>
    <button nz-button nz-popconfirm
            nzPopconfirmTitle="确认删除选中吗?"
            nzPopconfirmPlacement="right"
            (nzOnConfirm)="delete()"
            (nzOnCancel)="cancel()">删除
    </button>
  </div>

  <nz-table #basicTable [nzData]="dataList" [nzLoading]="loading" nzBordered nzSize="small">
    <thead>
    <tr>
      <th [nzChecked]="checked" [nzIndeterminate]="indeterminate" (nzCheckedChange)="onAllChecked($event)"></th>
      <th>单号</th>
      <th>名称</th>
      <th>设备编号</th>
      <th>设备名称</th>
      <th>养护类型</th>
      <th>负责人</th>
      <th>保养周期</th>
      <th>表达式</th>
      <th>开始时间</th>
      <th>结束时间</th>
      <th>操作区</th>
    </tr>
    </thead>
    <tbody>
    <tr *ngFor="let data of basicTable.data">
      <td
        [nzChecked]="setOfCheckedId.has(data.id)"
        [nzDisabled]="data.disabled"
        (nzCheckedChange)="onItemChecked(data.id, $event)"
      ></td>
      <td>{{data.code}}</td>
      <td>{{data.name}}</td>
      <td>{{data.device?.code}}</td>
      <td>{{data.device?.name}}</td>
      <td>{{deviceMaintainType[data.maintainType]}}</td>
      <td>{{data.user?.username}}</td>
      <td>{{data.cycle}}</td>
      <td>{{data.corn}}</td>
      <td>{{data.planStartTime| date:'yyyy-MM-dd HH:mm:ss'}}</td>
      <td>{{data.planEndTime| date:'yyyy-MM-dd HH:mm:ss'}}</td>
      <td>
        <a nz-button nzType="link" (click)="edit(data)"><i nz-icon nzType="edit"></i>编辑</a>
        <a nz-button nzType="link" (click)="delete(data.id)"><i nz-icon nzType="delete"></i>删除</a>
      </td>
    </tr>
    </tbody>
  </nz-table>

</nz-card>

<app-device-maintain-plan-edit #deviceMaintainPlanEditComponent (voted)="onSmt()"></app-device-maintain-plan-edit>
